<?php
namespace App\Models;
use Laravel\Scout\Searchable;
use Illuminate\Database\Eloquent\Model;
/**
 * Ceshi
 * created on 2020/7/29 15:28
 * created by chengzhigang
 */
class Ceshi extends Model
{
    use Searchable;

    protected $table = 'ceshi';
    protected $fillable = [
        'name','desc'
    ];

    /**
     * 定义索引里的type值,重写
     * @return string
     */
    public function searcheableAs()
    {
        return "_doc";
    }

    /**
     * 定义那些字段需要搜索
     * @return array
     */
    public function searchableArray()
    {
        return $this->only('id', 'name', 'desc');
    }
}
